#ifndef FZN_LINEGRID
#define FZN_LINEGRID
class CLineGrid
{
protected:
	__int64 m_radius1;
	CPoint m_origin ;
	int m_radius ;
	void _exchange(CPoint&x,CPoint&y){CPoint z=x;x=y;y=z;}
	int _for_x(__int64 y,__int64 step,int x1,int y1,int x2,int*buffer);
	int _for_y(__int64 x,__int64 step,int x1,int y1,int y2,int*buffer);
	int _for_x_u(__int64 y,__int64 step,int x1,int y1,int x2,int*buffer);
	int _for_x_d(__int64 y,__int64 step,int x1,int y1,int x2,int*buffer);
	int _for_y_u(__int64 x,__int64 step,int x1,int y1,int y2,int*buffer);
	int _for_y_d(__int64 x,__int64 step,int x1,int y1,int y2,int*buffer);
	void _GetGridInfo(CPoint point,int&x,int&y);
	int _GetGridInfo(CPoint star,CPoint end,int*buffer);
public:
	CLineGrid() ;
	~CLineGrid() ;
	void Set( int nRadius , CPoint origin ){ ASSERT( nRadius > 0 ) ; m_radius = nRadius ; m_origin = origin ;} 
	void GetGridInfo(CPoint point,int&x,int&y) ;
	int GetGridInfo(CPoint star,CPoint end,int*buffer) ;
};
#endif